package com.translate.web.service.impl;

import com.translate.web.dao.PayManagerMapper;
import com.translate.web.dao.PayManagerServiceMapper;
import com.translate.entity.PayManagerService;
import com.translate.web.service.IPayManagerServiceService;
import com.basic.service.impl.BaseServiceImpl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class PayManagerServiceServiceImpl extends BaseServiceImpl<PayManagerService>
		implements IPayManagerServiceService {
	public PayManagerServiceServiceImpl(PayManagerServiceMapper mapper) {
		super(mapper);
	}

	protected void insertPropteris(PayManagerService data) {
		long time = System.currentTimeMillis() / 1000;
		data.setCreateTime(time);
	}

	protected void updatePropteris(PayManagerService data) {
	}

	protected Class<PayManagerService> getEntityClass() {
		return PayManagerService.class;
	}

	@Override
	protected String getAssocKey() {
		// TODO Auto-generated method stub
		return "pay_manager_id";
	}

	@Override
	public List<PayManagerService> getPayManagerServices(long[] ids, int serviceType) {
		
		PayManagerServiceMapper managerMapper = this.getBaseMapper();
		
		return managerMapper.getPayManagerServices(ids, serviceType);
	}

	@Override
	@Transactional(propagation = Propagation.MANDATORY)
	public int cancelOrder(int managerId, int userId) {
		
		PayManagerServiceMapper managerMapper = this.getBaseMapper();
		
		return managerMapper.cancelOrder(managerId, userId);
	}
	
	
}